<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>IGNORED</title>
        <h:messages errorClass="errors" layout="list" showDetail="true" showSummary="false"/>
    </h:head>
    <h:body>
        <ui:composition template="/WEB-INF/Templates/Template.xhtml">
            <ui:define name="content">
                <h:form >
                    <h3 align="center"> #{tekster.Overskrift4} </h3>
                    <div align="center">
                        <h:panelGrid columns="3" border="0">
                            <h:column>
                                <h:outputText value="#{tekster.Fornavn}"/>
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.enDeltaker.fnavn}" required="true" id ="fnavn" requiredMessage="#{tekster.req_fnavn}" />
                            </h:column>
                            <h:column>
                                <h:message for="fnavn" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.Etternavn}"/>
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.enDeltaker.enavn}" required="true" id="enavn" requiredMessage="#{tekster.req_enavn}" />
                            </h:column>
                            <h:column>
                                <h:message for="enavn" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.adresse}"/>
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.enDeltaker.adresse}" required="true" id="adr" requiredMessage="#{tekster.req_adresse}"/>
                            </h:column>
                            <h:column>
                                <h:message for="adr" errorClass="errors"/> 
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.epost}"/>
                            </h:column>
                            <h:column>
                                <h:inputText value="#{rb.enDeltaker.epost}" required="true" id="ep" requiredMessage="#{tekster.req_epost}" validatorMessage="#{tekster.val_epost}">
                                    <f:validateRegex pattern="#{tekster.regexEpost}"/>
                                </h:inputText>
                            </h:column>
                            <h:column>
                                <h:message for="ep" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.fodtselsaar}"/>
                            </h:column>
                            <h:column>
                                <h:selectOneListbox size="5" required="true" id="faa" requiredMessage="#{tekster.req_faar}" value="#{rb.enDeltaker.faar}">
                                    <f:selectItems value="#{lister.aarsTall()}"/>     
                                </h:selectOneListbox>
                            </h:column>
                            <h:column>
                                <h:message for="faa" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.kjonn}"/>
                            </h:column>
                            <h:column>
                                <h:selectOneRadio required="true" id ="kj" requiredMessage="#{tekster.req_kjonn}" value="#{rb.enDeltaker.kjonn}">
                                    <f:selectItem itemValue ="Dame" itemLabel="#{tekster.Kvinne}"/> <!-- Norsk vs engelsk? -->
                                    <f:selectItem itemValue ="Mann" itemLabel="#{tekster.Mann}"/> <!-- Norsk vs engelsk? -->
                                </h:selectOneRadio>
                            </h:column>
                            <h:column>
                                <h:message for="kj" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.Passord}"/>
                            </h:column>
                            <h:column>
                                <h:inputSecret required="true" id="pw" requiredMessage="#{tekster.req_nyttpw}" value="#{rb.enDeltaker.passord1}" validatorMessage="#{tekster.val_passord}" converter="#{string}">
                                <!--f:validator validatorId="passord" disabled="true"/-->
                                <f:validateRegex pattern="#{tekster.regexPassord}"/>
                            </h:inputSecret>
                            </h:column>
                            <h:column>
                                <h:message for="pw" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:outputText value="#{tekster.Passord2}"/>
                            </h:column>
                            <h:column>
                                <h:inputSecret required="true" requiredMessage="#{tekster.req_gjpw}" id="pw2" value="#{rb.enDeltaker.passord2}" converter="#{string}"/>
                            </h:column>
                            <h:column>
                                <h:message for="pw2" errorClass="errors"/>
                            </h:column>
                            <h:column>
                                <h:commandButton value="#{tekster.Tilbake}" action="/index?faces-redirect=true" immediate="true"/>
                            </h:column>
                            <h:column>
                                <h:commandButton value="#{tekster.Send}" action="#{rb.nyDeltaker()}"/>
                            </h:column>
                        </h:panelGrid>
                    </div>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>